package com.example.braden.answergame.component;

import com.example.braden.answergame.base.BaseResult;
import com.example.braden.answergame.modules.main.domain.MyPropEntity;
import com.example.braden.answergame.modules.main.domain.ReadyEntity;
import com.example.braden.answergame.modules.main.domain.UsePropEntity;

import java.io.PrintWriter;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by braden on 2018/1/3.
 */

interface ApiInterface {
    //    String BASE_URL = "http://10.10.20.172:8082/";

    //String BASE_URL = "http://192.168.210.173:8086/";





    @GET("rtgame/getprop")
    Observable<MyPropEntity> mPropAPI(@Query("rid") String rid,
                                      @Query("openid") String openid, @Query("signs") String signs,
                                      @Query("timestamp") String timestamp);

    @POST("rtgame/getready")
    Observable<ReadyEntity> mReadyAPI(@Query("rid") String rid,
                                      @Query("openid") String openId, @Query("signs") String signs,
                                      @Query("timestamp") String timestamp);

    @POST("rtgame/useprop")
    Observable<UsePropEntity> mUseProp(@Query("rid") String rid,
                                       @Query("openid") String openid, @Query("qid") int qid, @Query("prop_id") String prop_id,
                                       @Query("signs") String signs, @Query("timestamp") String timestamp,
                                       @Query("is_use") int is_use);

    @POST("rtgame/answer")
    Observable<BaseResult> answerQustion(@Query("rid") String rid,
                                         @Query("openid") String openid, @Query("qid") int qid, @Query("answer") int answer,
                                         @Query("signs") String signs, @Query("timestamp") String timestamp);

    @GET("rtgame/getstart")
    Observable<BaseResult> mStartGameAPI(@Query("rid") String rid,
                                         @Query("openid") String openid, @Query("signs") String signs,
                                         @Query("timestamp") String timestamp);

    @POST("rtgame/quit")
    Observable<BaseResult> mQuitGame(@Query("rid") String rid,
                                     @Query("openid") String openid, @Query("signs") String signs,
                                     @Query("timestamp") String timestamp);
}
